#ifndef _FLASH_H
#define _FLASH_H

#include "stm32f10x.h"

#ifdef STM32F10X_MD
#define FLASH_BUFFER_SIZE 256
#else 
#define FLASH_BUFFER_SIZE 512
#endif

//#define USE_FLASH_OPERATION
#ifdef USE_FLASH_OPERATION
extern uint32_t flash_buffer[FLASH_BUFFER_SIZE];
#endif

int flash_read(uint32_t sectoraddr, uint32_t *buf, uint32_t len);
int flash_write(uint32_t sectoraddr, uint32_t *buf, uint32_t len);

#endif
